package com.yc.dict.entity;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yc.base.BaseSimpleEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serial;

/**
 * <p>
 * 后台字典详情表
 * </p>
 *
 * @author bao
 * @since 2021-12-10
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("yc_dict_detail")
@ApiModel(value = "DictDetail对象", description = "后台字典详情表")
public class DictDetail extends BaseSimpleEntity {

    @Serial
    private static final long serialVersionUID = -478009436029391834L;

    @ApiModelProperty(value = "标签(多语言)")
    @TableField("label")
    private String label;

    @ApiModelProperty(value = "值")
    @TableField("value")
    private String value;

    @ApiModelProperty(value = "字典id")
    @TableField("dict_id")
    private Long dictId;

    public DictDetail(DictDetail source) {
        BeanUtil.copyProperties(source, this);
    }


    public void copy(DictDetail source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
